<?php

namespace Database\Seeders;

use App\Models\Admin\SysDepartment;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class SysDepartmentSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {

        $dep = SysDepartment::create([
            'name' => '壹知产数字科技'
        ]);

        $deps = [
            [
                'name' => '市场营销部',

            ],
            [
                'name' => '运营部',

            ],
            [
                'name' => '售后服务部',

            ],
            [
                'name' => '技术开发部',

            ],
            [
                'name' => '人力资源部',
            ]
        ];

        // foreach($deps as $dep) {
        //     SysDepartment::create($dep);
        // }

        $dep->children()->createMany($deps);

    }
}
